{extend name="common/application" /}
{block name="title"}
<title>人才培训</title>
{/block}
{block name="css"}
<link rel="stylesheet" type="text/css" href="_CSS_/train.css"/>
<style>
	/* .bannerBox{height:500px;} */
	.bannerBox img{width:100%;height:auto;}
</style>	
{/block}

{block name="navbar"}{include file="/common/navbar" /}{/block}
{block name="content"}
<div class="main">
    <!--banner-->
	<div class="bannerBox">
		<img src=""/>	
	</div>	
<!--     <div id="slideBox" class="slideBox Carousel">
        <div class="hd normalBox">
            <ul>
                <li></li>
                <li></li>
                <li></li>
            </ul>
        </div>
        <div class="bd">
            <ul>
                <li>
                    <a href="javascript:;" target="_blank">
                        <img src="_IMG_/banner01.png"/>
                    </a>
                </li>
                <li>
                    <a href="javascript:;" target="_blank">
                        <img src="_IMG_/banner01.png"/>
                    </a>
                </li>
                <li>
                    <a href="javascript:;" target="_blank">
                        <img src="_IMG_/banner01.png"/>
                    </a>
                </li>
            </ul>
        </div>
        <div class="arrowArea normalBox">
            <a class="prev" href="javascript:void(0)"></a>
            <a class="next" href="javascript:void(0)"></a>
        </div>
    </div> -->
    <!--培训课程-->
    <div class="courses sectionArea normalBox">
        <h4 class="conHeader">
            <p class="sectionName fl">
                <span class="icons icon-course"></span>
                <span>培训·课程</span>
            </p>
            <a class="readMore fr" href="courses.html">查看更多<span class="icons icon-right"></span></a>
        </h4>
        <div class="conBody">

        </div>
    </div>
    <!--精英人才-->
    <div class="personnels sectionArea normalBox">
        <h4 class="conHeader">
            <p class="sectionName fl">
                <span class="icons icon-personnel"></span>
                <span>精英·人才</span>
            </p>
            <a class="readMore fr" href="persons.html">查看更多<span class="icons icon-right"></span></a>
        </h4>
        <div class="conBody">


        </div>
    </div>
    <!--学术师资-->
    <div class="teachers sectionArea normalBox">
        <h4 class="conHeader">
            <p class="sectionName fl">
                <span class="icons icon-teachers"></span>
                <span>学术·师资</span>
            </p>
            <a class="readMore fr" href="teachers.html">查看更多<span class="icons icon-right"></span></a>
        </h4>
        <div class="conBody">



        </div>
    </div>
</div>
{/block}

{block name="js"}
<script type="text/javascript">
    $(function () {
        /*加载banner*/
        $.ajax({
            type: "get",
            url: "/index.php/api/banner/banner_index",
            data: {'number': 3, 'sheet': 2, 'status': 1,},
            dataType: 'jsonp',
            success: function (msg) {
                if (msg.code == 200) {
					var src = '/Images/Banner/' + msg.data.data[0].img_url;
					$('.bannerBox img').attr('src',src);
                } else {
                    console.log('网络错误');
                }
            }
        });


        $.ajax({
            type: "get",
            url: "/index.php/api/video/management",
            data: {'number': 8, 'status': 1, 'episode': 1},
            dataType: 'jsonp',
            success: function (msg) {
                if (msg.code == 200) {
                    var html = '';
                    for (var i = 0; i < msg.data.data.length; i++) {
                        if (i == 3 || i == 7) {
                            html += '<div class="sectionItem mr0">';
                        } else {
                            html += '<div class="sectionItem">';
                        }
                        html += '<div class="imgBox">';
                        html += '<a class="links" href="courses_details.html?id=' + msg.data.data[i].id + '">';
                        html += '<img src="/Images/Cover/' + msg.data.data[i].pic + '"/></a></div>';
                        html += '<div class="courseCon">';
                        html += '<a class="links courseTitle text_overflow" href="courses_details.html?id=' + msg.data.data[i].id + '">' + msg.data.data[i].title + '</a>';
                        html += '<p class="Episodes">共<span class="EpisodesNum">' + msg.data.data[i].episode + '</span>集</p>';
                        html += '<p class="learner"><span class="learnerNum">' + msg.data.data[i].views + '</span>人学习</p>';
                        html += '<p class="praise"><span class="icons icon-praise"></span>' + msg.data.data[i].likes + '</p></div></div>';
                    }
                    $(".conBody").eq(0).html(html);
                }
            }
        });
		
		get_talent();
		get_teacher();
        
    })
	function get_talent(){
		$.ajax({
            type: "get",
            url: "/index.php/api/talent/index",
            dataType: 'jsonp',
			data:{'sheet':1},
            success: function (msg) {
                if (msg.code == 200) {
                    var html_one = "";                  
                    var k = 1;                  
                    for (var i = 0; i < msg.data.length; i++) {
                        var arr = msg.data[i].label.split(" ");
                        var label = "";
                        for (var m = 0; m < arr.length; m++) {
                            if (arr[m]) {
                                label += '<span class="labels">' + arr[m] + '</span>';
                            }
                        }
                        
						k++;
						if (k == 4 || k == 7) {
							html_one += '<div class="personInfo sectionItem mr0"><div class="userImg">';
						} else {
							html_one += '<div class="personInfo sectionItem"><div class="userImg">';
						}
						html_one += '<a class="links" href="persons_details.html?type=1&id=' + msg.data[i].id + '">';
						html_one += '<img src="/static/web/images/76.png" class="icon-wapper">';
						html_one += '<img src="/Images/Talent/' + msg.data[i].img_url + '" class="icon"></a></div>';
						html_one += '<a class="links username" href="persons_details.html?type=1&id=' + msg.data[i].id + '">' + msg.data[i].talentname + '</a>';
						html_one += '<p class="position">' + msg.data[i].rolename + '</p>';
						html_one += '<p class="position">' + label + '</p>';
						html_one += '<div class="areas moreline" limit="21">' + msg.data[i].field.substring(0, 54) + '</div></div>';
                            
                    }

                    
                    $(".conBody").eq(1).html(html_one);
                }
            }
        })
	}
	function get_teacher(){
		$.ajax({
            type: "get",
            url: "/index.php/api/talent/index",
            dataType: 'jsonp',
			data:{'sheet':2},
            success: function (msg) {
                if (msg.code == 200) {
                    var html_two = "";                  
                    var k = 1;                  
                    for (var i = 0; i < msg.data.length; i++) {
                        var arr = msg.data[i].label.split(" ");
                        var label = "";
                        for (var m = 0; m < arr.length; m++) {
                            if (arr[m]) {
                                label += '<span class="labels">' + arr[m] + '</span>';
                            }
                        }
                        
						k++;
						if (k == 4 || k == 7) {
							html_two += '<div class="personInfo sectionItem mr0"><div class="userImg">';
						} else {
							html_two += '<div class="personInfo sectionItem"><div class="userImg">';
						}
						html_two += '<a class="links" href="persons_details.html?type=1&id=' + msg.data[i].id + '">';
						html_two += '<img src="/static/web/images/76.png" class="icon-wapper">';
						html_two += '<img src="/Images/Talent/' + msg.data[i].img_url + '" class="icon"></a></div>';
						html_two += '<a class="links username" href="persons_details.html?type=2&id=' + msg.data[i].id + '">' + msg.data[i].talentname + '</a>';
						html_two += '<p class="position">' + msg.data[i].rolename + '</p>';
						html_two += '<p class="position">' + label + '</p>';
						html_two += '<div class="areas moreline" limit="21">' + msg.data[i].field.substring(0, 54) + '</div></div>';
                            
                    }

                    
                    $(".conBody").eq(2).html(html_two);
                }
            }
        })
	}
   

</script>
{/block}